<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
    <head>
        <meta charset="UTF-8" >
        <title>Title</title>
        <style>
            *{
                text-align: center;
            }
            .center {
                margin: auto;
                width: 54%;
            }
            a{
                color: black;
                text-decoration: none;
            }
            a:hover{
                color: black;
                text-decoration: none;
            }
        </style>
    </head>
    <body>
        <form action="/book/getAll" method="post">
            图书名称：<input type="text" th:name="name" th:value="${name}"/>
            图书类别：<input type="text" th:name="category" th:value="${category}"/>
            图书作者：<input type="text" th:name="author" th:value="${author}"/>
            <input type="submit" value="查询"/>
        </form>
        <a th:href="@{/book/toAdd}">新增</a>
        <div class="center">
            <table border="1">
                <tr>
                    <th>选择</th>
                    <th>编号</th>
                    <th>书名</th>
                    <th>价格</th>
                    <th>类目</th>
                    <th>库存</th>
                    <th>图片</th>
                    <th>说明</th>
                    <th>作者</th>
                    <th>已售</th>
                    <th>操作</th>
                </tr>
                <tr th:if="${book.size()==0}">
                    <td colspan="10">抱歉，未找到您要查询的数据!</td>
                </tr>
                <tr th:if="${book.size()>0}" th:each="list : ${book}">
                    <td>
                        <input type="checkbox"/>
                    </td>
                    <td th:text="${list.id}"></td>
                    <td th:text="${list.name}"></td>
                    <td th:text="${list.price}"></td>
                    <td th:text="${list.category}"></td>
                    <td th:text="${list.pnum}"></td>
                    <td th:text="${list.imgurl}"></td>
                    <td th:text="${list.description}"></td>
                    <td th:text="${list.author}"></td>
                    <td th:text="${list.sales}"></td>
                    <td>
                        <a th:href="@{/book/toUpdate(id=${list.id})}">修改</a>
                        <a th:href="@{/book/delete(id=${list.id})}">删除</a>
                    </td>
                </tr>
            </table>
        </div>
        <div>
            <a th:if="${!page.isFirstPage}"
               th:href="@{/book/getAll(start=${page.pageNum-1})}">上一页</a>
            总页数：<span th:text="${page.pages}"></span>
            当前页：<span th:text="${page.pageNum}"></span>
            总记录数：<span th:text="${page.size}"></span>
            <a th:if="${!page.isLastPage}"
               th:href="@{/book/getAll(start=${page.pageNum+1})}">下一页</a>
        </div>
    //href="https://gitee.com/element-plus/element-plus/commits/gh-pages"
    </body>
</html>